/**
 * Created by ray on 17-6-14.
 */
/**
 * Created by ray on 17-6-9.
 */
/**
 * Sample React Native App
 * https://github.com/facebook/react-native
 * @flow
 */


import React,{ Component,PropTypes } from 'react';
import {
    StyleSheet,
    View,
    Text
} from 'react-native'


export default class MineContent extends Component {

    render() {

        return (

            <View style = {[styles.container,styles.border]}>
                <View style = {styles.flex}>
                    <Text

                    >
                        content placeHolder
                    </Text>
                    <MineGroup
                        onPress ={this.props.onPressOrder}
                        onPressDetil = {()=>alert("ss")}
                    />

                </View>
            </View>

        );
    }
}

// export class MineGroup extends Component {
//   render(){
//       return(
//           <View style={styles.group}>
//               <Text    onPress={this.props.onPressOrder}>
//                   订单
//               </Text>
//
//               <Text>
//                   收藏
//               </Text>
//
//               <Text>
//                   other
//               </Text>
//           </View>
//       )
//   }
//
// };


export const MineGroup = ({
    onPressOrder,
    onPressDetil,
    onPress,


}) => (
    <View style={styles.group}>
        <Text    onPress={onPress}>
            订单
        </Text>

        <Text onPress={onPress}>
            收藏
        </Text>

        <Text>
            other
        </Text>
    </View>
);

const propTypes = {
    onPressOrder:PropTypes.func,
    onPressDetil:PropTypes.func,
    onPress:PropTypes.func.isRequired,
};

MineGroup.prototype = propTypes;





const styles = StyleSheet.create({
    container:{
        flex:1,
        backgroundColor:'pink',
    },
    flex:{
        flex:1
    },
    border:{
        borderWidth:0.5,
        borderColor:'gray'
    },
    group:{
        flexDirection:"row",
        height:100,
        justifyContent:'space-between',
        padding:25,
        backgroundColor:'#FFF'
    }

});